<?php

namespace Xin\EasyQueue\Hyperf;

use Hyperf\AsyncQueue\Driver\DriverFactory;
use Hyperf\Context\ApplicationContext;
use Xin\EasyQueue\Contracts\QueueInfo;

class RedisQueueInfo implements QueueInfo
{
    /**
     * @var string
     */
    protected $queue;


    /**
     * @var string
     */
    protected $connection;

    /**
     * @return array
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    protected function load()
    {
        $factory = ApplicationContext::getContainer()->get(DriverFactory::class);
        $driver = $factory->get($this->queue);

        return $driver->info();
    }

    public function waiting(int $start = 0, int $end = -1): array
    {
        // TODO: Implement waiting() method.
    }

    public function waitingName(): string
    {
        // TODO: Implement waitingName() method.
    }

    public function waitingCount(): int
    {
        // TODO: Implement waitingCount() method.
    }

    public function delayed(int $start = 0, int $end = -1): array
    {
        // TODO: Implement delayed() method.
    }

    public function delayedName(): string
    {
        // TODO: Implement delayedName() method.
    }

    public function delayedCount(): int
    {
        // TODO: Implement delayedCount() method.
    }
}
